Skip to content

fix: restore OpenCode text responses - #239

Merged
SaladDay merged 1 commit into
mainfrom
fix/opencode-response-parser
Sep 4, 2026
Merged

fix: restore OpenCode text responses#239
SaladDay merged 1 commit into
mainfrom
fix/opencode-response-parser

Conversation

@kapelame

@kapelame kapelame commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What changed

OpenCode emits assistant output from opencode run --format json as top-level text events with content under part.text. The daemon previously ignored those events and could persist a completed run with no output.

This PR:

  • translates current text events into Parsar delta and final output;
  • accumulates usage from each step_finish payload, including nested cache counters;
  • keeps the existing message.part.delta text format supported.

Scope

Included:

  • the OpenCode event parser;
  • focused parser regression tests.

Excluded:

  • other OpenCode event types and pre-existing error presentation;
  • Claude Code, Codex, Pi, model, MCP, API, database, storage, and frontend behavior.

Validation

  • go test ./apps/parsar-daemon/internal/agent/opencode ./server/internal/connector/agentdaemon
  • go build -o /tmp/parsar-daemon-pr239 ./apps/parsar-daemon/cmd/parsar-daemon
  • make check (passed; the repository check skipped its Postgres migration smoke test because Docker is unavailable)
  • two independent blind-review rounds plus one final convergence review; final review: no findings

@SaladDay
SaladDay force-pushed the fix/opencode-response-parser branch from f14b27d to a2e8ea3 Compare September 4, 2026 10:15
@SaladDay
SaladDay marked this pull request as ready for review September 4, 2026 10:15
@SaladDay
SaladDay merged commit b7d0a3c into main Sep 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants